<template>
  <div>
    <div>
      <router-link to="/login">Login</router-link>
      <router-link :to="`/home?time=${Date.now()}`">Home</router-link>
      <router-link to="/home2">Home2</router-link>
    </div>
    <hr>
    <transition name="one">
      <router-view></router-view>
    </transition>
  </div>
</template>

<script>
export default {
  name: 'App',
}
</script>

<style scoped>
a {
  margin: 0 10px;
}

/* 显示/隐藏的过渡样式 */
.one-enter-active, .one-leave-active {
  transition: all 1s;
}

/* 进入前隐藏时的样式 */
.one-enter {
  opacity: 0;
  transform: translateX(-100%);
}

/* 离开后隐藏时的样式 */
.one-leave-to {
  opacity: 0;
  transform: translateX(100%);
}

/* 让离开的元素不占位空间, 避免要显示的内容被挤到下面了(显示过程中) */
.one-leave-active {
  position: absolute;
}
</style>
